package com.um.jdy.platform.activity.controller;

import com.um.jdy.platform.activity.manager.CouponsStationManager;
import com.um.jdy.platform.station.entity.vo.StationItemVO;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 控制器：优惠券站场
 */
@RestController
@RequestMapping("/api/v1/cms/activity/coupons/station")
@Api(tags = "营销管理")
@ApiPermission("coupons_station")
@TokenRequired
public class CouponsStationController extends BaseController<CouponsStationManager> {

    @ApiPermission("list")
    @ApiOperation(value = "查询优惠券可用的站场")
    @GetMapping("list")
    public Response<List<StationItemVO>> getCouponsGoods(@ApiParam(value = "优惠券id") @NotEmpty String activity_coupons_id) {
        return Response.success(manager.getCouponsStations(activity_coupons_id));
    }


}
